<template>
	<view>
		<view class="pop">
			<view class="header">
				<view class="title">
					{{headerTitle}}
				</view>
				<image @click="close" class="icon-42" src="../../static/btn_close.png" mode="widthFix"></image>
			</view>
			<image class="icon" :src="icon" mode="widthFix"></image>
			<view class="text">
				礼物将消耗<text>{{number}}</text>
				<block v-if="pay_type==1">积分</block>
				<block v-if="pay_type==2">现金</block>
			</view>
			<view class="title">
				{{desc}}
			</view>
			<view class="btn-group">
				<view class="btn cancel" @click="close">
					取消
				</view>
				<view class="btn confirm" @click="confirm">
					确定
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		name: "n-popup",
		data() {
			return {

			};
		},
		props: {
			show: {
				type: Boolean,
				default: false
			},
			icon: {
				type: String,
				default: require('@/static/popup_gift.png')
			},
			headerTitle: {
				type: String,
				default: '赠送礼物'
			},
			title: {
				type: String,
				default: '提交成功'
			},
			pay_type:{
				type: String,
				default: ''
			},
			number: {
				type: String,
				default: ''
			},
			desc: {
				type: String,
				default: '确定赠送吗？'
			}
		},
		methods: {
			confirm() {
				console.log('confirm')
				this.$emit('confirm')
			},
			close() {
				this.$emit('close')
			}
		}
	}
</script>

<style lang="scss">
	.pop {
		width: 580upx;
		background: linear-gradient(180deg, #EEFFF6 0%, #FFFFFF 100%);
		box-shadow: 0px 6upx 12upx rgba(153, 153, 153, 0.8);
		text-align: center;

		.header {
			position: relative;
			padding-top: 46upx;

			.title {
				font-size: 32upx;
				font-weight: 500;
				color: #333333;
			}

			.icon-42 {
				position: absolute;
				right: 40upx;
				top: 46upx;
			}
		}

		.icon {
			width: 364upx;
			margin: 92upx auto 0;
		}

		.text {
			font-size: 24upx;
			font-weight: 400;
			color: #999999;
			margin-top: 10upx;

			text {
				color: #FF0000;
				font-size: 36upx;
			}
		}

		.title {
			font-size: 34upx;
			font-weight: bold;
			color: #333333;
		}

		.btn-group {
			margin-top: 74upx;
			@include flex;

			.btn {
				flex: 1;
				line-height: 88upx;
				font-size: 30upx;
				font-weight: 500;
			}

			.cancel {
				color: #999999;
				background: #F0F0F0;
			}

			.confirm {
				color: #FFFFFF;
				background: #519D76;
			}
		}
	}
</style>
